<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/base2.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/style2.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
		<title>渠道商管理-渠道商列表-待审核</title>
	</head>
	<body>
		<div class="page">
			<div class="header">
				<div class="header_top"></div>
				<div class="header_bottom clearfix">
					<div class="header_logo fl">
						<img src="${pageContext.request.contextPath}/images/images/index-logo.png">
					</div>
					<ul class="header_nav clearfix fl">
						<li>
							<a href="order_ddlb_duan.html">订单管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/supplier/list/pass/1.html" class="on">渠道商管理</a>
						</li>
						<li>
							<a href="financial_zhanghu.html">财务管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/members/list/1.html">用户管理</a>
						</li>
						<li>
							<a href="money_lb_fafang.html">红包管理</a>
						</li>
						<li>
							<a href="account_zhgl.html">账户管理</a>
						</li>
					</ul>
					<div class="header_user fr">
						<img src="${pageContext.request.contextPath}/images/images/user.png">欢迎您，<i>${ sessionScope.MANAGER_NAME} </i><a herf="${pageContext.request.contextPath}//manager/loginout.html">【切换账号】</a>
					</div>
				</div>
			</div>
			<div class="main clearfix">
				<div class="main_menu fl">
					<div class="menu_name on">
						<a href="${pageContext.request.contextPath}/supplier/list/pass/1.html">
							<img src="${pageContext.request.contextPath}/images/images/channel_lb.png">
							<p>渠道商列表</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/supplier/accountList/1.html">
							<img src="${pageContext.request.contextPath}/images/images/channel_account.png">
							<p>渠道商账户</p>
						</a>
					</div>
					<div class="menu_name add_people">
						<a href="${pageContext.request.contextPath}/supplier/addSupplier.html">
							<img src="${pageContext.request.contextPath}/images/images/channel_add.png">
							<p>添加渠道商</p>
						</a>
					</div>
				</div>
				<div class="main_cont fl">
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_title fl">当前位置：渠道商管理 > 渠道商列表 > 待审核</div>
							<div class="cont_top_time fr"><i>
							<a href="${pageContext.request.contextPath}/supplier/list/review/1.html">
							<img src="${pageContext.request.contextPath}/images/images/refresh.png">刷新
							</a>
							</i></div>
						</div>
					</div>
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_time fr pr">
								<form action="${pageContext.request.contextPath}/supplier/list/review/1.html">
									<input type="search" placeholder="请输入人渠道商名查询" class="search_txt" name="wSName">
									<input type="submit" value="搜索" class="search pa" style="top:6px;right: 0;">
								</form>
							</div>
						</div>
					</div>
					<div class="main_cont_bottom_channelPass">
						<div class="main_inner">
							<ul class="main_cont_title clearfix">
								<li>
									<a href="${pageContext.request.contextPath}/supplier/list/pass/1.html">已通过【3】</a>
								</li>
								<li>
									<a href="${pageContext.request.contextPath}/supplier/list/review/1.html" class="on">待审核【3】</a>
								</li>
							</ul>
							<div class="batch">
							<a onclick="datacheck();">
							<img src="${pageContext.request.contextPath}/images/images/pass.png">批量通过
							</a>
							</div>
							<table>
							    <tr>
							    	<th><input type="checkbox" class="checked" id="checkAll"></th>
							        <th>渠道商编号</th> 
							        <th>渠道商名</th> 
							        <th>电话</th>
							        <th>联系人</th>
							        <th>所在城市</th> 
							        <th>所在区县</th> 
							        <th>具体地址</th>
							        <th>加入时间</th>
							        <th>审核状态</th> 
							        <th>操作</th>
							    </tr> 
							    
							     <c:forEach items="${PAGE_BEAN.dataList}" var="supplier">
							      <tr> 
							        <td><input type="checkbox" class="checked" value="${supplier.id}" name="idArray"></td> 
							        <td>${supplier.id }</td> 
							        <td>${supplier.wSName }</td>
							        <td>${supplier.wSTelephone }</td> 
							        <td>${supplier.wSContact }</td> 
							        <td>${supplier.wSCity }</td>
							        <td>${supplier.wSDistrict }</td> 
							        <td>${supplier.wSAddress }</td>
							        <td><fmt:formatDate value="${supplier.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
							        <td>
							    	<c:if test="${supplier.status eq 0}">
									停用
									</c:if>
									<c:if test="${supplier.status eq 1}">
									启用
									</c:if>
									<c:if test="${supplier.status eq 2}">
									待审核
									</c:if>  
									<c:if test="${supplier.status eq 3}">
									不通过
									</c:if>
									<c:if test="${supplier.status eq 4}">
									通过
									</c:if>         
							       </td> 
							        <td>
							        <i>
							        
									 <a href="#" onclick="shenhei(${supplier.id },3)">不通过</a>
								
									 <a href="#" onclick="shenhei(${supplier.id },4)">通过</a>
									
									</i>
							        </td>
							    </tr> 
							    </c:forEach>
							    
							  
							</table> 
							<%@ include file="/WEB-INF/views/page.jsp"%>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<script type="text/javascript">
		
		function shenhei(id,flags){
			 if(id!="" && flags!=""){
				 $.ajax({
					 	url:"/supplier/check/"+id+".json?flag="+flags,
						success: function(data){
							alert(data.info);
						}
					});
			 }
		}
		
		/*渠道-通过*/
		function datacheck(){
			    var chk_value =[];    
			      
				$('input[name="idArray"]:checked').each(function(){    
				   chk_value.push($(this).val()); 
				});
				
				if(chk_value.length==0){
					alert("请选择渠道商！");
					return false;
				}
				  
				var param = "";
				for(var i = 0; i < chk_value.length; i++) {
					param += chk_value[i] + "-";
				}
				
				$.ajax(
						{url:"/supplier/checkall/" + param + ".json",
						async:false,
						success: function(data){
							alert(data.info);
						}
				});
		}
		
	    $("#checkAll").bind("click", function () {
	    	$("[name=idArray]:checkbox").prop("checked", this.checked);
	    });

		$("input[name='idArray']").click(function() {
		    var $subs = $("input[name='idArray']");
			$("#checkAll").prop("checked",$subs.length == $subs.filter(":checked").length ? true : false);
		});

		
		</script>
		
	</body>
</html>
